//
//  GetWebContentViewController.m
//  GetWebContent
//

#import "GetWebContentViewController.h"

@implementation GetWebContentViewController

- (void)viewDidLoad {
    [super viewDidLoad];
	
	NSLog(@"started");
	
	CGRect resultsFrame = CGRectMake(10,10,300,100);
	resultsView = [[UITextView alloc] initWithFrame:resultsFrame];
	resultsView.font = [UIFont systemFontOfSize:14.0];
	[self.view addSubview:resultsView];
	
	NSString *symbol = @"AAPL,GOOG,MSFT,YHOO,PALM";
	NSString *urlString = [NSString
						   stringWithFormat:@"http://finance.yahoo.com/d/quotes.csv?f=no&s=%@",
						   symbol];
	
	NSURL *url = [NSURL URLWithString:urlString];
	NSString *quotes = [NSString stringWithContentsOfURL:url
												encoding:NSUTF8StringEncoding
												   error:nil];
	resultsView.text = quotes;
	
	NSLog(@"done");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

- (void)dealloc {
	[resultsView release];
    [super dealloc];
}

@end
